repeat
Repeat this list n
times.
Examples:
[1, 2, 3].repeat(3)
returns[1, 2, 3, 1, 2, 3, 1, 2, 3]
list<T>().repeat(3)
returns[]
(for any typeT
)[3].repeat(0)
returns[]
Return
a new list with the elements from this list repeated n
times
Since
0.11.0
Parameters
n
the number of times to repeat this list
Throws
exception
when:
n
is negativen
is greater than(2^31)-1
the resulting list has size greater than
(2^31)-1